/**
 * @date 2006-2-27 13:03:33
 *
 */
package org.nanhill.xmlro.spring;

import java.lang.reflect.Method;

import javax.servlet.http.HttpServletRequest;

import org.nanhill.xmlro.XmlroTransport;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.web.servlet.mvc.Controller;

/**
 * Xmlro Ajax Controller Exporter.
 * 
 * @author alin [xalinx at gmail dot com]
 * 
 */
public abstract class AbstractXmlroControllerExporter implements Controller,
		InitializingBean {

	/**
	 * Xmlro agent.
	 */
	protected XmlroTransport xmlroAgent;

	/**
	 * Set Xmlro agent.
	 * 
	 * @param xmlroAgent
	 */
	public void setXmlroAgent(XmlroTransport xmlroAgent) {
		this.xmlroAgent = xmlroAgent;
	}

	/**
	 * Get remote call service instance.
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	protected abstract Object getCallService(HttpServletRequest request)
			throws Exception;

	/**
	 * Get remote call service method.
	 * 
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	protected abstract Method getCallMethod(HttpServletRequest request,
			Object service) throws Exception;
}
